package com.chif.mapreduce.writable;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;


public class CustomPartitioner extends Partitioner<Text,FlowBean> {
    @Override
    public int getPartition(Text text, FlowBean flowBean, int numPartitions) {
        String phone=text.toString();
        //控制分区代码逻辑返回不同的分区代码
        if (phone.equals("13560436666")){
            return 1;
        } else if (text.equals("13560436667")){
            return 2;
        }
        return 0;


    }
}
